package pers.xiaojun.boot.module.system.controller.user.vo.user;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.Size;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import pers.xiaojun.boot.common.constants.DateTimePatternConstants;
import pers.xiaojun.boot.common.enums.CommonStatusEnum;
import pers.xiaojun.boot.common.pojo.PageParam;
import pers.xiaojun.boot.common.validation.constraints.InEnum;

import java.time.LocalDateTime;

/**
 * 用户分页/条件查询实体
 *
 * @author xiaojun
 * @since 2025-11-05
 */
@Schema(description = "用户分页/条件查询实体-VO")
@Data
@EqualsAndHashCode(callSuper = true)
public class UserPageReqVO extends PageParam {

    @Schema(description = "用户账号，模糊匹配", example = "xiaojun")
    private String username;

    @Schema(description = "手机号码，模糊匹配", example = "12345678900")
    private String mobile;

    @Schema(description = "展示状态，参见 CommonStatusEnum 枚举类", example = "1")
    @InEnum(value = CommonStatusEnum.class, message = "状态必须为 {value}")
    private Integer status;

    @Schema(description = "创建时间", example = "[2022-07-01 00:00:00, 2022-07-01 23:59:59]")
    @DateTimeFormat(pattern = DateTimePatternConstants.ISO_DATE_TIME)
    @Size(min = 2, max = 2, message = "创建时间必须包含起止时间")
    private LocalDateTime[] createTime;

    @Schema(description = "部门编号，同时筛选子部门", example = "1")
    private Long deptId;

    @Schema(description = "角色编号", example = "1")
    private Long roleId;

}
